﻿-- Define the relationship between PersonModel and Person
ALTER TABLE [dbo].[PersonModel] WITH CHECK ADD  
       CONSTRAINT [FK_PersonModel_Person] FOREIGN KEY([PersonId])
REFERENCES [dbo].[Person] ([PersonId])
ON DELETE NO ACTION
GO
-- Define the relationship between PersonModel and Model
ALTER TABLE [dbo].[PersonModel] WITH CHECK ADD  
       CONSTRAINT [FK_PersonModel_Model] FOREIGN KEY([ModelId])
REFERENCES [dbo].[Model] ([ModelId])
ON DELETE NO ACTION
GO
-- Define the relationship between PersonModel and Person
ALTER TABLE [dbo].[PersonModel] WITH CHECK ADD  
       CONSTRAINT [FK_PersonModel_CreatedByPerson] FOREIGN KEY([CreatedBy])
REFERENCES [dbo].[Person] ([PersonId])
ON DELETE NO ACTION
GO